//
//  WBNetworkTool.h
//  WeiBoOC
//
//  Created by 韩菲菲 on 16/8/11.
//  Copyright © 2016年 韩菲菲. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
#import "WBUserAccount.h"

//枚举 请求类型 POST 还是 GET
typedef enum {

    GET,
    POST
    
} WBNetworkToolMethod;

@interface WBNetworkTool : AFHTTPSessionManager

 //单例
+ (instancetype)sharedWBNetworkTool;


//给外界提供一个接口，请求数据  
- (void)requestWithWBNetworkToolMethod:(WBNetworkToolMethod)method andURLString:(NSString *)urlString andParameters:(id)parameters andSuccess:(void(^)(id responseObject))success andFailure:(void(^)(NSError *error))failure;


//专门根据code请求token的接口
- (void)getUserTokenWithCode:(NSString *)code andSuccess:(void(^)(id responseObject))success andFailure:(void(^)(NSError *error))failure;

//根据token去请求个人信息
- (void)getUserInfoWithUserAccessToken:(WBUserAccount *)userAccount andSuccess:(void(^)(id responseObject))success andFailure:(void(^)(NSError *error))failure;

//请求首页数据
- (void)getHomeDataWithMaxId:(int64_t)maxId andSinceId:(int64_t)sinceId andSuccess:(void(^)(id responseObject))success andFailure:(void(^)(NSError *error))failure;

//发布文字微博接口
- (void)updateSinaWithStatus:(NSString *)status andSuccess:(void(^)(id responseObject))success andFailure:(void(^)(NSError *error))failure;
//发布图片文字接口
- (void)uploadSinaWithStatus:(NSString *)status andImage:(UIImage *)image andSuccess:(void(^)(id responseObject))success andFailure:(void(^)(NSError *error))failure;

@end
